home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
pluginy Firefox
/
3006
/
3006.xpi
/
chrome
/
dwhelper.jar
/
content
/
media-list.xml
< prev
next >
Wrap
Extensible Markup Language
|
2010-01-15
|
5KB
|
222 lines
<?xml version="1.0"?>
<!-- *****************************************************************************
* Copyright (c) 2006-2009 Michel Gutierrez. All Rights Reserved.
****************************************************************************** -->
<!DOCTYPE bindings SYSTEM "chrome://dwhelper/locale/dwhelper.dtd" >
<bindings xmlns="http://www.mozilla.org/xbl"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:xbl="http://www.mozilla.org/xbl">
<binding id="MediaList" extends="widgets.xml#widget">
<xbl:content xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<tree
anonid="xTree"
id="dwhelper-media-list"
flex="1"
enableColumnDrag="true"
hidecolumnpicker="false"
flags="dont-build-content"
datasources="rdf:null"
ref="urn:none"
>
<treecols>
<treecol
id="dwhelper-media-list-col0"
anonid="xCol0"
xbl-persist="medialist-col0:width,ordinal,hidden,sortActive,sortDirection"
primary="true"
flex="1"
label="&column.file-name;"
sort="?url"
/>
<splitter class="tree-splitter"/>
<treecol
id="dwhelper-media-list-col1"
anonid="xCol1"
xbl-persist="medialist-col1:width,ordinal,hidden,sortActive,sortDirection"
primary="false"
flex="1"
label="&column.media-url;"
sort="?url"
hidden="true"
/>
<splitter class="tree-splitter"/>
<treecol
id="dwhelper-media-list-col2"
anonid="xCol2"
xbl-persist="medialist-col2:width,ordinal,hidden,sortActive,sortDirection"
primary="false"
flex="1"
label="&column.source-url;"
sort="?pageurl"
hidden="true"
/>
<splitter class="tree-splitter"/>
<treecol
id="dwhelper-media-list-col3"
anonid="xCol3"
primary="false"
flex="1"
label="&column.view-date;"
xbl-persist="medialist-col3:width,ordinal,hidden,sortActive,sortDirection"
sortActive="true" sortDirection="descending"
sort="?date"
/>
</treecols>
<template>
<rule>
<conditions>
<content uri="?root"/>
<member container="?root" child="?media"/>
<triple subject="?media"
predicate="http://downloadhelper.net/1.0#url"
object="?url"/>
</conditions>
<bindings>
<binding subject="?media"
predicate="http://downloadhelper.net/1.0#filename"
object="?filename"/>
<binding subject="?media"
predicate="http://downloadhelper.net/1.0#pageurl"
object="?pageurl"/>
<binding subject="?media"
predicate="http://downloadhelper.net/1.0#date"
object="?date"/>
<binding subject="?media"
predicate="http://downloadhelper.net/1.0#datestr"
object="?datestr"/>
</bindings>
<action>
<treechildren>
<treeitem
uri="?media" open="true">
<treerow>
<treecell
label="?filename"
/>
<treecell
label="?url"
/>
<treecell
label="?pageurl"
/>
<treecell
label="?datestr"
/>
</treerow>
</treeitem>
</treechildren>
</action>
</rule>
</template>
</tree>
<children style="display: none;"/>
</xbl:content>
<implementation>
<constructor>
<![CDATA[
this.util.setDatasource(this.xTree,this.mediaListMgr.getDataSource());
setTimeout(function(_this) { _this.doMonitorXBLPersist=true; },0,this);
]]>
</constructor>
<method name="setList">
<parameter name="list"/>
<body>
<![CDATA[
//dump("[media-list] setList("+list+")\n");
this.list=list;
if(list==null)
this.xTree.setAttribute("ref","urn:none");
else
this.xTree.setAttribute("ref",list);
]]>
</body>
</method>
<method name="getList">
<body>
<![CDATA[
return this.list;
]]>
</body>
</method>
<method name="getSelectedMedia">
<body>
<![CDATA[
var selectCount = this.xTree.view.selection.count;
if(selectCount>0) {
var res=this.xTree.builderView.getResourceAtIndex(this.xTree.currentIndex);
if(res!=null) {
return res.Value;
}
}
return null;
]]>
</body>
</method>
<method name="getSelectedMedias">
<body>
<![CDATA[
var sel=[];
try {
if(this.xTree.view==null)
return sel;
if(this.xTree.view.selection.count<1)
return sel;
if(this.xTree.builderView==null)
return sel;
var numRanges = this.xTree.view.selection.getRangeCount();
for (var t=0; t<numRanges; t++){
var start={};
var end={};
this.xTree.view.selection.getRangeAt(t,start,end);
for (var v=start.value; v<=end.value; v++) {
if(v>=0) {
var res=this.xTree.builderView.getResourceAtIndex(v);
sel.push(res);
}
}
}
return sel;
} catch(e) {
return [];
}
]]>
</body>
</method>
</implementation>
<handlers>
<handler event="dblclick">
<![CDATA[
this.fireEvent("MediaDblClicked");
]]>
</handler>
<handler event="select">
<![CDATA[
this.fireEvent("MediaSelect");
]]>
</handler>
</handlers>
</binding>
</bindings>